package com.example.ssmdemo.controller;

import com.example.ssmdemo.common.Userinfo;
import com.example.ssmdemo.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/user")
public class UserController {
    @Autowired
    private UserService userService;
    @RequestMapping("/getuserbyid")
    public Userinfo getUserById(Integer id){
        if(id==null) return null;
        return userService.getUserById(id);
    }
}
